stage.set_background("schoolentrance")
sprite = codesters.Sprite("cheerleader4")
sprite.move_down(150)
t = codesters.Teacher()
turn_rights = t.find_function("turn_right")
tval1 = len(turn_rights)
try:
tval2 = int(stage.get_wait_time())
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 1, "Great job!")
t1.add_failure(tval1 == 0, "Did you add a turn right command?")
t1.add_creative(tval1 > 1, "Wow! The sprite did more than one flip.")
t2 = TestObjective()
t2.add_success(tval2 == 2, "Great Job!")
t2.add_failure(tval2 == 0, "Did you add a wait command?")
t2.add_creative(tval2 != 2 and tval2 != 0, "That is a creative choice!")
tester = TestManager()
tester.add_test_list([t2, t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)